package app

import (
	"fmt"
	"github.com/sirupsen/logrus"
	"my-desktop/config"
	"net/http"
)

var App = &MyServer{}

type MyServer struct{}

func (app *MyServer) Start() {
	appAddr := fmt.Sprintf("%s:%d", config.App.Host, config.App.Port)

	server := http.Server{
		Addr: appAddr,
	}

	logrus.Info("App Running At " + appAddr)
	Router()

	if err := server.ListenAndServe(); err != nil {
		logrus.Error("application run faild")
	}
}
